﻿
{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">编辑发货单 [ <a href="__URL__">返回列表</a> ]
  
    <div class="btn-group pull-right">
      <a href="__URL__/print_export/id/{$vo.id}" target="_blank" class="btn btn-primary">打印出库单</a>
    </div>
  </h3>
<div id="result" class="result none"></div>
<!--no use tab any-->
<ul id="myTab" class="nav nav-tabs">
    <li  class="active"><a href="#home" data-toggle="tab">发货单概要</a></li>
    <li><a href="__URL__/detail/id/{$_REQUEST.id}">产品信息</a></li>
    
</ul>
 <div id="myTabContent" class="tab-content">
            
    <div class="tab-pane fade in active" id="home">

<form class="form-horizontal well" method='post' id="form1" action="__URL__/update/">
<table cellpadding=3 cellspacing=3 >
<tr>
	<td class="tRight" >发货单号：</td>
	<td class="tLeft" >{$vo.mano}   </td>
</tr>
<tr>
    <td class="tRight" >销售单号：</td>
    <td class="tLeft" >{$vo.order_id|getModelName='Order','mano'}</td>
</tr>
<php>$customer_id = getModelName($vo['order_id'],'Order','customer_id');</php>
<tr>
	<td class="tRight" >客户：</td>
	<td class="tLeft" ><a href="__APP__/Customer/edit/id/{$customer_id}" target="_blank">{$customer_id|getModelName='Customer'} </a></td>
</tr>
<tr>
    <td>地址：</td>
    <td><textarea name="address" class="input-xxlarge" rows="5">{$vo.order_id|getModelName='Order','address'}</textarea></td>
</tr>
<tr>
    <td>货值：</td>
    <td><input type="text" name="total" value="{$vo.total}"></td>
</tr>
<tr>
    <td>毛重：</td>
    <td><input type="text" name="weight" value="{$vo.weight}"></td>
</tr>
<tr>
    <td>净重：</td> <td><input type="text" name="net_weight" value="{$vo.net_weight}"></td>
</tr>
<tr>
    <td>物流公司：</td>
    <td>{:configList(C('foreignlogi'),$vo['logi_id'],'logi_id')}</td>
</tr>
<tr>
    <td>物流单号：</td>
    <td><input type="text" name="logi_no" value="{$vo.logi_no}"></td>
</tr>
<tr>
    <td>物流跟踪信息：</td>
    <td> <textarea name="information" class="span7" rows=3>{$vo.information}</textarea> </td>
</tr>
<tr>
	<td class="tRight" >经办人：</td>
	<td class="tLeft" >{:modList('User')} {$vo.create_time|toDate}</td>
</tr>
<tr>
    <td>发货单状态：</td>
    <td>{:configList(C('shippingStatus'),$vo['status'])}</td>
</tr>
<tr>
	<td></td>
	<td class="center" width="300">
        <input type="hidden" value="{$vo.id}" name="id">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
	<button type="reset" onclick="javascript:history.back()" class="btn btn-primary offset1"><i class="icon-arrow-left icon-white"></i> 返回</button>
	</td>
</tr>
</table>
</form>
<?php 
    $map = 'shipping_id = '.$vo['id'] ;
    $products = M('Shipping_detail')->where($map)->order('id desc')->findAll(); 
            
 ?>
<table class="table table-bordered table-striped">
    <tr> <th colspan=10 class="heading alert alert-info">产品信息</th><th><a class="btn btn-primary" href="__APP__/Toshipping/search?shipping_id={$vo.id}&dstatus=4&customer_id={$customer_id}" colspan="2" >增补订单</a> </th> </tr>
            <tr><th>编号</th><th>销售分单号</th><th>备注</th> <th>订单要求</th> <th>产品中文</th><th>英文名称</th><th>CAS</th><th>数量</th><th>单价</th> <th>单位</th><th>货值</th><th>运费</th><th>总计</th><th>增加备注</th> </tr>
            <volist name="products" id="ca">
                <tr>
                <td>{$ca.id}</td>
                <?php $order_detail = M('Order_detail')->getById($ca['order_detail_id']); ?>
                <td>{$order_detail.mano}</td>
                <td>{$ca.order_detail_id|getMsgTip}</td>
                <td>{$order_detail.order_id|getModelName='Order','remark'}</td>
                <php>
                    $product = M('Product');
                    $product->getById($ca['product_id']);
                </php>
                <td>{:$product->name}</td>
                <td>{:$product->ename}</td>
                <td>{:$product->cas}</td>
                <td>{$ca.number}</td>
                <td>{$ca.price}</td>
                <td>{$ca.order_detail_id|getModelName='Order_detail','unit_id'|getModelName='Unit'}</td>
                <td>{$ca.total}{$order_detail.order_id|getModelName='Order','currency'|getConfigVal='Currency'}</td>
                <td>{$ca.logifee}</td><!--运费TODO 来自小分单的运费设置-->
                <td>{$ca['sum_total']}</td>
                <td><a class="btn btn-primary" href="__APP__/Message/add/obj_type/Order_detail/depart/仓库/obj_id/{$ca.order_detail_id}/return_type/Shipping/return_id/{$vo.id}"><i class="icon-comment icon-white"></i> 创建备注</a></td>
            </tr>
            </volist>
        </table>

<?php 
    $map = 'shipping_id = '.$vo['id'] ;
    $packages = M('Package')->where($map)->order('id desc')->findAll(); 
            
 ?>
<table class="table table-bordered table-striped">
    <tr> <th colspan=9 class="heading alert alert-info">包装信息</th> </tr>
    <tr><th>编号</th><th>包装类型</th><th>毛重</th> <th>长(CM)</th><th>宽(CM)</th><th>高(CM)</th><th>标签内容</th><th>粗略重量</th></tr>
    <volist name="packages" id="pa">
        
        <tr>
            <form action="__APP__/Package/update" method="post">
            <td>{$pa.id} <input type="hidden" name="id" value="{$pa.id}"> </td>
            <td>{:configList(C('packtype'),$pa['pack_type'],'pack_type')}</td>
            <td><input type="text" name="pack_weight" value="{$pa.pack_weight}" class="span1"> </td>
            <td><input type="text" name="length" value="{$pa.length}" class="span1"> </td>
            <td><input type="text" name="width" value="{$pa.width}" class="span1"> </td>
            <td><input type="text" name="height" value="{$pa.height}" class="span1" > </td>
            <td><input type="text" name="pack_desc" value="{$pa.pack_desc}" class="span4" > </td>
            <td><input type="text" name="about_net_weight" value="{$pa.about_net_weight}" class="span1" > </td>
            <td> <eq name="vo.status" value="0"> <input type="submit" value="修改" class="btn btn-primary"> </eq></td>
            </form>
            <td> <a href="__APP__/Package/foreverdelete/id/{$pa.id}" class="btn btn-primary">删除</a> </td>
        </tr>
        
    </volist>
    <form action="__APP__/Package/insert" method="post" name="pack_form">
    <tr><td>1</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} 
                <input type="hidden" name="shipping_id" value="{$vo.id}">
            </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr><td>2</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr><td>3</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr><td>4</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr><td>5</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr><td>6</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr><td>7</td>
            <td> {:configList(C('packtype'),-1,'pack_type[]' )} </td>
            <td> <input type="text" name="pack_weight[]" value="" class="span1">  </td>
            <td><input type="text" name="length[]" value="" class="span1"></td>
            <td><input type="text" name="width[]" value="" class="span1"> </td>
            <td> <input type="text" name="height[]" value="" class="span1">  </td>
            <td><input type="text" name="pack_desc[]" class="span4" value=""></td>
            <td><input type="text" name="about_net_weight[]" class="span1" value=""></td>
            
        </tr>
        <tr> <td colspan="8">
            <input type="hidden" name="jumpUrl" value="__SELF__"> 
            <input type="hidden" name="status" value="1"><!--打包完成状态-->
          <eq name="vo.status" value="0">  <input type="submit" value="打包完成" class="btn btn-primary"> </td> </eq> </tr>
        <eq name="vo.status" value="0"></form></eq>
</table>

</div>
</div>
</div>
<include file="Public:footer" />
